home *** CD-ROM | disk | FTP | other *** search
/ PC go! 2008 April / PCgo 2008-04 (DVD).iso / interface / contents / demoversionen_3846 / 13664 / files / Data1.cab / stdafx.h21 < prev    next >
Encoding:
Text File  |  2006-05-31  |  2.3 KB  |  85 lines

  1. // stdafx.h : include file for standard system include files,
  2. //      or project specific include files that are used frequently,
  3. //      but are changed infrequently
  4.  
  5. #if !defined(AFX_STDAFX_H__2BBD995D_6D09_4793_BA09_1BEBB9BAFFCF__INCLUDED_)
  6. #define AFX_STDAFX_H__2BBD995D_6D09_4793_BA09_1BEBB9BAFFCF__INCLUDED_
  7.  
  8. #if _MSC_VER > 1000
  9. #pragma once
  10. #endif // _MSC_VER > 1000
  11.  
  12. #define STRICT
  13. #ifndef _WIN32_WINNT
  14. #define _WIN32_WINNT 0x0400
  15. #endif
  16. #define _ATL_APARTMENT_THREADED
  17.  
  18. #include <afxwin.h>
  19. #include <afxdisp.h>
  20. #include <afxdlgs.h>
  21.  
  22. #include <atlbase.h>
  23. //You may derive a class from CComModule and use it if you want to override
  24. //something, but do not change the name of _Module
  25. extern CComModule _Module;
  26. #include <atlcom.h>
  27.  
  28. #include "imsigx.h"
  29. #include "xdbtool.h"
  30. #include "gxties.h"
  31.  
  32. #include <comdef.h>
  33. #define TYPELIB_MAJOR    1
  34. #define TYPELIB_MINOR    0
  35. #define NUM_TOOLS        1
  36.  
  37.  
  38. #define CHECK_HRESULT(hr) if (FAILED(hr)) throw hr;
  39. #define CHECK_POINTER(p) if (p == NULL) throw E_OUTOFMEMORY;
  40. #define TRACE_EXCEPTION(f) TRACE1("Exception in %s\n", ##f);
  41.  
  42. #define RELEASE(pI) if (pI != NULL) {pI->Release(); pI = NULL;}
  43. #define ADDREF(pI) pI != NULL ? pI->AddRef() : 0;
  44.  
  45. #define FOR_EACH(INTERFACE, pObj, pObjs)                    \
  46.     {                                                        \
  47.         HRESULT hr = S_OK;                                    \
  48.         ULONG celt = 1;                                        \
  49.         ULONG fetched = 0;                                    \
  50.         VARIANT varObj;                                        \
  51.         ::VariantInit(&varObj);                                \
  52.         IEnumVARIANT* pEnum = NULL;                            \
  53.         try                                                    \
  54.         {                                                    \
  55.             hr = pObjs->get__NewEnum((IUnknown**)&pEnum);    \
  56.             if (FAILED(hr)) throw hr;                        \
  57.             hr = pEnum->Reset();                            \
  58.             if (FAILED(hr)) throw hr;                        \
  59.             while (TRUE)                                    \
  60.             {                                                \
  61.                 ::VariantClear(&varObj);                    \
  62.                 pObj = NULL;                                \
  63.                 hr = pEnum->Next(celt, &varObj, &fetched);    \
  64.                 if (fetched == 0)                            \
  65.                     break;                                    \
  66.                 pObj = (##INTERFACE *)varObj.pdispVal;         
  67.  
  68.  
  69. #define NEXT(pObj)                \
  70.             }                        \
  71.         }                            \
  72.         catch (...)                    \
  73.         {                            \
  74.         }                            \
  75.         ::VariantClear(&varObj);    \
  76.         if (pEnum != NULL)            \
  77.             pEnum->Release();        \
  78.         pObj = NULL;                \
  79.     }
  80.  
  81. //{{AFX_INSERT_LOCATION}}
  82. // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
  83.  
  84. #endif // !defined(AFX_STDAFX_H__2BBD995D_6D09_4793_BA09_1BEBB9BAFFCF__INCLUDED)
  85.